<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>资金明细管理</title>
	<%@ include file="/view/common/tags.jsp"%>
	<script type="text/javascript" src="${sysManagerV1}/js/My97DatePicker/WdatePicker.js"> </script>
</head>
<body>
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <div class="box-body">
                       <div class="panel panel-default">
                            <div class="panel-body" style="padding-bottom:5px;">
                                <form class="form-horizontal" action="" method="post" id="dataForm">
                                    <input type="hidden" id="token" name="token" value=""/>
                                	<div class="searchMenu">
                                        <div>
                                            <label>交易类型：</label>
                                            <sk:select cssClass="form-control select" id="tradeTypeId" name="wm[TRADE_TYPE_ID]" value="${page.wm.TRADE_TYPE_ID}" requiredInit="true" ajaxURL="${fundCenterV1}/fundFinanceMoneyFlowDetail/findTransferTypeDictList">
                                                <option value="">请选择</option>
                                            </sk:select>
                                        </div>
                                        <div>
                                            <label>进出标志：</label>
                                            <sk:select cssClass="form-control select" id="inOutFlag" name="wm[IN_OUT_FLAG]" value="${page.wm.IN_OUT_FLAG}">
                                                <option value="">请选择</option>
                                                <option value="0">入</option>
                                                <option value="1">出</option>
                                            </sk:select>
                                        </div>
                                        <div>
                                            <label>资金来源：</label>
                                            <sk:select cssClass="form-control select" id="saleRechargeFlag" name="wm[SALE_RECHARGE_FLAG]" value="${page.wm.SALE_RECHARGE_FLAG}">
                                                <option value="">请选择</option>
                                                <option value="0">充值</option>
                                                <option value="1">销售</option>
                                                <option value="2">押金</option>
                                            </sk:select>
                                        </div>
                                        <div>
                                            <label>退款标识：</label>
                                            <sk:select cssClass="form-control select" id="flowReturnStatus" name="wm[FLOW_RETURN_STATUS]" value="${page.wm.FLOW_RETURN_STATUS}">
                                                <option value="">请选择</option>
                                                <option value="0">否</option>
                                                <option value="1">是</option>
                                            </sk:select>
                                        </div>
                                        <div>
                                            <label>用户名称：</label>
                                            <input type="text" class="form-control" name="wm[_LIKE$USER_NAME]" value="${page.wm._LIKE$USER_NAME}" placeholder="">
                                        </div>
                                        <div>
                                            <label>相关订单号：</label>
                                            <input type="text" class="form-control" name="wm[_LIKE$RELATION_ORDER_NO]" value="${page.wm._LIKE$RELATION_ORDER_NO}" placeholder="">
                                        </div>
                                	</div>
                                    <div class="searchMenu" style="width: 100%;float: left;">
                                        <div>
                                            <label>创建时间：</label>
                                            <input id="createTimeStart" name="wm[_MORE_EQUAL$CREATE_TIME]" value="${page.wm._MORE_EQUAL$CREATE_TIME}"  type="text"  class="Wdate"
                                                   onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',startDate:'%y-%M-%d 00:00:00',alwaysUseStartDate:true,maxDate:'#F{$dp.$D(\'createTimeEnd\')}',minDate:'#F{$dp.$D(\'createTimeEnd\',{d:-30,H:-23,m:-59,s:-59})}'})" />
                                            <span class="pull-left">&nbsp;-&nbsp;</span>
                                            <input id="createTimeEnd" name="wm[_LESS_EQUAL$CREATE_TIME]" value="${page.wm._LESS_EQUAL$CREATE_TIME}"  class="Wdate"
                                                   onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',startDate:'%y-%M-%d 23:59:59',alwaysUseStartDate:true,minDate:'#F{$dp.$D(\'createTimeStart\')}',maxDate:'#F{$dp.$D(\'createTimeStart\',{d:+30,H:+23,m:+59,s:+59})}'})" />
                                        </div>
                                        <div class="mal10" >
                                            <button type="button"  class="btn btn-primary btn-sm"  onclick="findData()"><span class='glyphicon glyphicon-search'></span>查&nbsp;询</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <table class="table table-hover table-condensed table-bordered table-striped" id="dataTable" >
                            <thead>
                                <tr>
                                	<th data-field="index" data-align="center" data-formatter="indexFormatter" data-sortable="false">序号</th>
                                    <th data-field="flowNo" data-align="center">流水号</th>
                                    <th data-field="tradeTypeName" data-align="center">交易类型</th>
                                    <th data-field="userName" data-align="center">用户名称</th>
                                    <th data-field="inOutFlag" data-align="center" data-formatter="inOutFlagFormatter">进出标志</th>
                                    <th data-field="createTime" data-align="center"  data-formatter="timeFormatter_point" data-sortable="true">创建时间</th>
                                    <th data-field="tradeMoney" data-align="center" data-formatter="toDecimal" data-sortable="true">交易金额</th>
                                    <th data-field="tradeMoneyAfter" data-align="center" data-formatter="toDecimal" data-sortable="true">操作后金额</th>
                                    <th data-field="saleRechargeFlag" data-align="center" data-formatter="saleRechargeFlagFormatter">资金来源</th>
                                    <th data-field="relationOrderNo" data-align="center">相关订单号</th>
                                    <th data-field="flowDesc" data-align="center">流水说明</th>
                                    <th data-field="flowReturnStatus" data-align="center" data-formatter="flowReturnStatusFormatter">退款标识</th>
                                </tr>
                            </thead>
                        </table>
                   	</div>
            	</div>
           	</div>
		</div>
    </section>
   <%@ include file="/view/common/footer.jsp"%>
</body>
<script>
// 提示信息
var msgg='<%=request.getAttribute("msg")%>';
if( msgg && msgg!=null && msgg!='null'){ 
	  layer.msg(msgg);
}
function inOutFlagFormatter(value, row) {
    var html = "";
    if (row.inOutFlag == 0) {
        html = "<span class='text-success'>入 </span>&nbsp;&nbsp;&nbsp;&nbsp;"
    } else if (row.inOutFlag == 1) {
        html = "<span class='text-warning'>出 </span>&nbsp;&nbsp;&nbsp;&nbsp;";
    }
    return html;
}
function saleRechargeFlagFormatter(value, row) {
    var html = "";
    if (row.saleRechargeFlag == 0) {
        html = "<span class='text-success'>充值 </span>&nbsp;&nbsp;&nbsp;&nbsp;"
    } else if (row.saleRechargeFlag == 1) {
        html = "<span class='text-warning'>销售 </span>&nbsp;&nbsp;&nbsp;&nbsp;";
    } else if (row.saleRechargeFlag == 2) {
        html = "<span class='text-warning'>押金 </span>&nbsp;&nbsp;&nbsp;&nbsp;";
    }
    return html;
}
function flowReturnStatusFormatter(value, row) {
    var html = "";
    if (row.flowReturnStatus == 0) {
        html = "<span class='text-success'>否 </span>&nbsp;&nbsp;&nbsp;&nbsp;"
    } else if (row.flowReturnStatus == 1) {
        html = "<span class='text-warning'>是 </span>&nbsp;&nbsp;&nbsp;&nbsp;";
    }
    return html;
}
// 加载table 数据
$(function(){
    $("#token").val(sessionStorage.getItem("token"));
    $("#dataTable").bootstrapTable({
        url: "${fundCenterV1}/fundFinanceMoneyFlowDetail/listPage",
        method:"get",
        contentType: "application/x-www-form-urlencoded",
        pagination:true,
        sidePagination:"server",
        queryParams: function(params) {
            return $.extend({}, params, parseJson(decodeURIComponent($("#dataForm").serialize())));
        }
    });
})

function findData(){
    $("#dataTable").bootstrapTable("refresh",{} );
}

/*bootstrap table点击行事件*/
$(function(){
    $("body").on("click","table>tbody>tr",function(){
        $(this).css("background","#e1ecf1").siblings().css("background","");
    });
})
</script>
</html>